<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //const声明常量
        //  const dog = '旺财';
        //  console.log(dog); //旺财

        //不允许重复声明
        //  const a = 1;
        //  const a = 3;
        //  console.log(a); //SyntaxError: Identifier 'a' has already been declared


        // 不允许重复声明 注意：对数组元素的修改和对对象内部的修改是可以的（数组和对象存的是引用地址）
        //基本数据类型
        const sex = 'male';
        sex = 'female';
        console.log(sex); //Assignment to constant variable.

        //引用数据类型
        const person = {
            username: 'Cai'
        }
        person.username = 'Zhangsan',
            console.log(person);
    </script>
</body>

</html>